/**
 * 
 */
package com.p2p.base.service.impl;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.p2p.base.dao.LoginCountDao;
import com.p2p.base.model.LoginCount;
import com.p2p.base.service.LoginCountService;

/**
 * @author ruiqi
 *
 */
@Service("loginCountService")
public class LoginCountServiceImpl implements LoginCountService {

	@Resource
	private LoginCountDao loginCountDao;
	
	@Override
	public boolean updateSuccessTimes(LoginCount loginCount) {
		return 1==loginCountDao.updateSuccessTimes(loginCount);
	}

	@Override
	public boolean updateWrongTimes(String uid) {
		return 1==loginCountDao.updateWrongTimes(uid);
	}

	@Override
	public boolean create(String uid) {
		LoginCount loginCount = new LoginCount();
		loginCount.setUid(uid);
		return create(loginCount);
		
	}

	@Override
	public LoginCount getByUid(String uid) {
		return loginCountDao.getByUid(uid);
	}

	@Override
	public boolean create(LoginCount loginCount) {
		loginCountDao.create(loginCount);
		return true;
	}

}
